package com.hyg.lib_common.DataModel.testting;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author: Administrator
 * @date: 2021/3/17
 */
public class TesttingAnswer implements Parcelable {

    String answer;
    boolean isChoose = false;


    public TesttingAnswer() {
    }

    public TesttingAnswer(String answer, boolean isChoose) {
        this.answer = answer;
        this.isChoose = isChoose;
    }

    protected TesttingAnswer(Parcel in) {
        answer = in.readString();
        isChoose = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(answer);
        dest.writeByte((byte) (isChoose ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TesttingAnswer> CREATOR = new Creator<TesttingAnswer>() {
        @Override
        public TesttingAnswer createFromParcel(Parcel in) {
            return new TesttingAnswer(in);
        }

        @Override
        public TesttingAnswer[] newArray(int size) {
            return new TesttingAnswer[size];
        }
    };

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public boolean isChoose() {
        return isChoose;
    }

    public void setChoose(boolean choose) {
        isChoose = choose;
    }

    @Override
    public String toString() {
        return "TesttingAnswer{" +
                "answer='" + answer + '\'' +
                ", isChoose=" + isChoose +
                '}';
    }



}
